<!doctype html>
<html ng-app="myApp">
<head>
  <link rel="stylesheet" href="http://cdn.jsdelivr.net/foundation/4.3.2/css/foundation.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular.js"></script>
  <style>
    .red {
      background-color: red;
    }
  </style>
</head>
<body>

<div ng-controller="LotteryController">
  <div ng-class="{red: x > 5}" ng-if="x > 5">
    You won!
  </div>
  <button ng-click="x = generateNumber()" ng-init="x = 0">Draw Number</button>
  <p>Number is: {{ x }}</p>
</div>

  <script>
    angular.module('myApp', [])
    .controller('LotteryController', function($scope) {
      $scope.generateNumber = function() {
        return Math.floor((Math.random()*10)+1);
      }
    })
  </script>

</body>
</html>